import request from '@/utils/request';

/**
 * 座位管理API
 */

// 分页查询座位列表
export const getSeatListAPI = (params) => {
  return request({
    url: '/seat/list',
    method: 'get',
    params
  });
};

// 获取座位详细信息
export const getSeatInfoAPI = (id) => {
  return request({
    url: `/seat/${id}`,
    method: 'get'
  });
};

// 新增座位
export const addSeatAPI = (seatData) => {
  return request({
    url: '/seat',
    method: 'post',
    data: seatData
  });
};

// 修改座位
export const updateSeatAPI = (seatData) => {
  return request({
    url: '/seat',
    method: 'put',
    data: seatData
  });
};

// 删除座位
export const deleteSeatAPI = (ids) => {
  return request({
    url: '/seat/' + ids.map(id => Number(id)).join(','), // 确保转换为数字
    method: 'delete'
  });
};
